package com.yc.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yc.system.entity.Book;
import com.yc.system.entity.Store;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 书店 Mapper 接口
 * </p>
 *
 * @author 1850140986@qq.com
 * @since 2022-12-06
 */
@Mapper
public interface StoreMapper extends BaseMapper<Store> {

    @Select("select * from t_store ")
    List<Store> getStoresByPageRandom(IPage<Store> page, @Param(Constants.WRAPPER) QueryWrapper<Store> queryWrapper, @Param("status") int status);

    @Select("select * from t_store  where user_id=#{userId}")
    Store getStoreByUserId(int userId);

}
